using MauiBuilder.ViewModels;

namespace MauiBuilder.Views
{
    /// <summary>
    /// Socket连接管理页面
    /// 提供TCP Socket客户端连接、消息收发和状态监控功能
    /// </summary>
    public partial class SocketPage : ContentPage
    {
        private readonly SocketViewModel _viewModel;

        public SocketPage(SocketViewModel viewModel)
        {
            InitializeComponent();
            BindingContext = _viewModel = viewModel;
        }

        /// <summary>
        /// 页面出现时的处理
        /// </summary>
        protected override void OnAppearing()
        {
            base.OnAppearing();
        }

        /// <summary>
        /// 页面消失时的处理
        /// </summary>
        protected override void OnDisappearing()
        {
            base.OnDisappearing();
            _viewModel?.OnDisappearing();
        }
    }
}